package chapter2.No2_1_synchronized同步方法.h同步不具有继承性;

/**
 * !
 *
 * @author liujian
 * @version 2016/11/11 0011
 */
public class SuperTestObject {

    public synchronized void methodA() {
        try {
            System.out.println("线程："+Thread.currentThread().getName()+" SuperTestObject的methodA方法开始执行!!!");
            Thread.sleep(1000);
            System.out.println("线程："+Thread.currentThread().getName()+" SuperTestObject的methodA方法结束执行!!!");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

}
